package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.model.ProductUpdateStatus;
import com.ruoyi.system.domain.Technician;
import com.ruoyi.system.mapper.TechnicianMapper;
import com.ruoyi.system.service.ITechnicianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class TechnicianServicImpl implements ITechnicianService {

    @Autowired
    private TechnicianMapper technicianMapper;

    @Override
    public List<Technician> selectAllTechnician(Technician technician) {
        return technicianMapper.selectAllTechnician(technician);
    }

    @Override
    public Technician selectTechnicianById(Long id) {
        return technicianMapper.selectTechnicianById(id);
    }

    @Override
    public int updateTechnician(Technician technician) {
        return technicianMapper.updateTechnician(technician);
    }

    @Override
    public int updateStatus(Technician technician) {
        return technicianMapper.updateStatus(technician);
    }

    @Override
    public int insertTechnician(Technician technician) {
        return technicianMapper.insertTechnician(technician);
    }

    @Override
    public void deleteTechnicianByIds(Long[] ids) {
        for (Long id : ids) {
            technicianMapper.deleteTechnicianById(id);
        }
    }

    @Override
    public int updateIfIndex(Technician technician) {
        return technicianMapper.updateIfIndex(technician);
    }

    @Override
    public int batchUpdateStatus(ProductUpdateStatus productUpdateStatus) {
        return technicianMapper.batchUpdateStatus(productUpdateStatus.getIds(), productUpdateStatus.getStatus());
    }

    @Override
    public List<Technician> selectList(Technician technician) {
        return technicianMapper.selectList(technician);
    }


}
